package edu.zju.gis.dbfg.server.mapper;

import edu.zju.gis.dbfg.common.base.BaseMapper;
import edu.zju.gis.dbfg.server.interceptor.UserAuth;
import edu.zju.gis.dbfg.server.model.ParallelModel;
import edu.zju.gis.dbfg.server.model.ParallelModelWithBLOBs;
import edu.zju.gis.dbfg.server.model.vo.PublicModelsInfo;

import java.util.Collection;
import java.util.List;

public interface ParallelModelMapper extends BaseMapper<ParallelModelWithBLOBs, String> {

    int deleteByPrimaryKey(String artifactId);

    int insert(ParallelModelWithBLOBs record);

    int insertSelective(ParallelModelWithBLOBs record);

    @UserAuth
    List<PublicModelsInfo> selectAll(String userId);

    List<PublicModelsInfo> selectByUserId(String userId);

    List<ParallelModel> selectByIdList(Collection<String> idList);

    ParallelModelWithBLOBs selectByPrimaryKey(String artifactId);

    int updateByPrimaryKeySelective(ParallelModelWithBLOBs record);

    int updateByPrimaryKeyWithBLOBs(ParallelModelWithBLOBs record);

    int updateByPrimaryKey(ParallelModel record);

    default int updateByPrimaryKey(ParallelModelWithBLOBs record) {
        return updateByPrimaryKeyWithBLOBs(record);
    }
}